home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
C
/
LIB
/
YLIB
/
ylib_0_10
/
fpa_errors
< prev
next >
Wrap
Text File
|
1993-09-20
|
7KB
|
175 lines
estimates of errors :
The routines were compared with VAX real*16 routines. Given below are
the range of arguments tested, the number of entries tested, the
maximum observed error and the root mean square error.
The arguments were produced at random.
The result of the routines was kept in extended precision.
Note that for some routines there is no way to avoid loss of signifiance for
some range of arguments. This is true for example for the trigonometric
functions at large arguments.
Note that the double precision accuracy is about 0.2e-15 ( 1 + 0.2e-15 != 1).
sqrt
relative error
range of |arg| #entries max_err rms_err
[ 0.000E+00, 0.316 ] 2018 0.304E-17 0.146E-17
[ 0.316 , 3.16 ] 18169 0.301E-17 0.145E-17
[ 3.16 , 31.6 ] 2011 0.305E-17 0.151E-17
[ 31.6 , 316. ] 1908 0.304E-17 0.143E-17
[ 316. , 0.316E+04] 1019 0.308E-17 0.160E-17
[ 0.316E+04, 0.316E+05] 969 0.303E-17 0.151E-17
[ 0.316E+05, ] 906 0.304E-17 0.149E-17
---------------------
exp(x)
relative error
[ 0.000E+00, 0.693 ] 6987 0.148E-17 0.643E-18
[ 0.693 , 6.93 ] 14591 0.134E-17 0.598E-18
[ 6.93 , 69.3 ] 2084 0.347E-16 0.491E-17
[ 69.3 , 693. ] 2338 0.521E-16 0.190E-16
---
2**x
relative error
[ 0.000E+00, 0.100 ] 983 0.124E-17 0.671E-18
[ 0.100 , 1.00 ] 9174 0.149E-17 0.634E-18
[ 1.00 , 10.0 ] 12073 0.301E-17 0.633E-18
[ 10.0 , 100. ] 2179 0.221E-16 0.743E-17
[ 100. , 0.100E+04] 1591 0.233E-16 0.987E-17
-----------------
exp(x)-1
relative error
[ 0.000E+00, 1.00 ] 9927 0.565E-17 0.209E-17
[ 1.00 , 2.00 ] 10073 0.151E-17 0.591E-18
-----------------
for log and log10 there is a loss of significance as x-> 0.
log
absoulute error
[ 0.000E+00, 0.100 ] 634 0.214E-17 0.204E-18
[ 0.100 , 1.00 ] 5751 0.504E-18 0.182E-18
[ 1.00 , 10.0 ] 14310 0.599E-18 0.191E-18
[ 10.0 , 100. ] 1938 0.800E-18 0.208E-18
[ 100. , 0.100E+04] 1716 0.102E-17 0.272E-18
[ 0.100E+04, 0.100E+05] 1007 0.342E-17 0.871E-18
[ 0.100E+05, ] 1644 0.376E-17 0.159E-17
----------------
log10
absoulute error
[ 0.000E+00, 0.100 ] 634 0.428E-18 0.182E-18
[ 0.100 , 1.00 ] 5751 0.417E-18 0.108E-18
[ 1.00 , 10.0 ] 14310 0.392E-18 0.698E-19
[ 10.0 , 100. ] 1938 0.441E-18 0.171E-18
[ 100. , 0.100E+04] 1716 0.506E-18 0.164E-18
[ 0.100E+04, 0.100E+05] 1007 0.506E-18 0.180E-18
[ 0.100E+05, ] 1644 0.652E-18 0.235E-18
-----------------
sin
relative error
[ 0.000E+00, 1.57 ] 10045 0.880E-18 0.275E-18
absoulute error
[ 1.57 , 15.7 ] 11057 0.340E-17 0.335E-18
[ 15.7 , 157. ] 1924 0.343E-16 0.722E-17
[ 157. , 0.157E+04] 1526 0.341E-15 0.626E-16
[ 0.157E+04, 0.157E+05] 993 0.363E-14 0.657E-15
[ 0.157E+05, 0.157E+06] 978 0.347E-13 0.710E-14
[ 0.157E+06, ] 477 0.373E-13 0.110E-13
----
cos
absoulute error
[ 0.000E+00, 1.57 ] 10045 0.605E-18 0.197E-18
[ 1.57 , 15.7 ] 11057 0.356E-17 0.337E-18
[ 15.7 , 157. ] 1924 0.364E-16 0.700E-17
[ 157. , 0.157E+04] 1526 0.317E-15 0.599E-16
[ 0.157E+04, 0.157E+05] 993 0.344E-14 0.697E-15
[ 0.157E+05, 0.157E+06] 978 0.365E-13 0.693E-14
[ 0.157E+06, ] 477 0.342E-13 0.113E-13
--------------------------
tan
for all known methods there is a serious loss of significance near
x = pi/2 (and multiples thereof).
relative error
[ 0.000E+00, 0.196 ] 1241 0.442E-18 0.110E-18
[ 0.196 , 0.393 ] 1252 0.260E-18 0.759E-19
[ 0.393 , 0.785 ] 2498 0.589E-18 0.190E-18
[ 0.785 , pi ] 5054 0.217E-14 0.305E-16
the error in the last interval is meaningless, you should therefore look
at the interval
[ 0.0 , pi/2-1/1000] 10037 0.232E-16 0.622E-18
---------------------------------------
asin
relative error
[ 0.000E+00, 0.707 ] 14132 0.446E-17 0.150E-17
[ 0.707 , 1.00 ] 5868 0.214E-17 0.762E-18
------------------------
acos
absoulute error
[ 0.000E+00, 0.707 ] 14132 0.169E-17 0.528E-18
[ 0.707 , 1.00 ] 5868 0.170E-17 0.618E-18
-----------------------
atan
relative error
[ 0.000E+00, 0.707 ] 7133 0.268E-17 0.482E-18
[ 0.707 , 7.07 ] 14451 0.494E-18 0.189E-18
[ 7.07 , 70.7 ] 1914 0.238E-18 0.106E-18
[ 70.7 , 707. ] 1275 0.198E-18 0.101E-18
[ 707. , 0.707E+04] 1026 0.197E-18 0.999E-19
[ 0.707E+04, 0.707E+05] 919 0.197E-18 0.997E-19
[ 0.707E+05, ] 282 0.196E-18 0.995E-19
-----------------------
sinh
relative error
[ 0.000E+00, 1.00 ] 10157 0.229E-17 0.725E-18
[ 1.00 , 10.0 ] 12073 0.428E-17 0.739E-18
[ 10.0 , 100. ] 2179 0.372E-16 0.115E-16
[ 100. , 0.100E+04] 1591 0.519E-16 0.194E-16
------------------------------------
cosh
relative error
[ 0.000E+00, 1.00 ] 10157 0.847E-18 0.326E-18
[ 1.00 , 10.0 ] 12073 0.428E-17 0.633E-18
[ 10.0 , 100. ] 2179 0.372E-16 0.115E-16
[ 100. , 0.100E+04] 1591 0.519E-16 0.194E-16
-----------------------------------
tanh
relative error
[ 0.000E+00, 1.00 ] 10155 0.546E-17 0.146E-17
[ 1.00 , 10.0 ] 12038 0.611E-18 0.206E-18
[ 10.0 , 100. ] 1912 0.320E-18 0.588E-19
[ 100. , 0.100E+04] 1002 0.000E+00 0.000E+00
[ 0.100E+04, 0.100E+05] 1007 0.000E+00 0.000E+00
[ 0.100E+05, 0.100E+06] 886 0.000E+00 0.000E+00
---------------------------
atan2(x,y)
is basically the atan routine. I give stats for both |x| and |y|
between 0 and 1.e5
relative error
[ 0.000E+00, 0.100E+6] 17500 0.429E-17 0.293E-18
-----------------------------------------
pow(x,y)
is calculated as exp(y*ln(x))
the error can be obtained in more detail from the errors of exp and ln
we give typical examples where the range given is the one of the result
relative error
[ 0.000E+00, 0.100E-02] 1737 0.189E-15 0.431E-16
[ 0.100E-02, 0.100E-01] 228 0.113E-16 0.118E-17
[ 0.100E-01, 0.100 ] 446 0.284E-17 0.828E-18
[ 0.100 , 1.00 ] 5054 0.215E-17 0.653E-18
[ 1.00 , 10.0 ] 4958 0.287E-17 0.656E-18
[ 10.0 , 100. ] 452 0.222E-17 0.723E-18
[ 100. , 0.100E+04] 235 0.277E-17 0.998E-18
[ 0.100E+04, 0.100E+05] 158 0.468E-17 0.138E-17
[ 0.100E+05, 0.000E+00] 1732 0.199E-15 0.415E-16
-----------------------------
pow(x,y)
where y is an integer
relative error
x is used a range
[ 0.000E+00, 1.00 ] 5245 0.314E-17 0.154E-18
[ 1.00 , 10.0 ] 7539 0.352E-16 0.804E-18
[ 10.0 , 100. ] 2216 0.450E-16 0.835E-17